package com.ikun.service.impl;

import com.ikun.mapper.BusinessMapper;
import com.ikun.pojo.Business;
import com.ikun.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service


public class BusinessServiceImpl implements BusinessService {

    @Autowired
    BusinessMapper businessMapper;

    /**
     * 查询所有的商家
     * @return
     */
    @Override
    public List<Business> getAllBusinesses() {
        return businessMapper.getAllBusinesses();
    }

    @Override
    public Business getBusinessById(Integer id) {
        return businessMapper.getBusinessById(id);
    }

    /**
     * 根据classId查询该分类下的商家
     * @param classId
     * @return
     */
    @Override
    public List<Business> getBusinessesByClassId(Integer classId) {
        return businessMapper.getBusinessesByClassId(classId);
    }
}
